package cn.fqb.controller;

import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class GuakeController {

    @RequestMapping(value = "/guakezhishu", method = RequestMethod.GET)
    public void guakezhishu() {
        System.out.println("guakezhishu");
    }
    
    @RequestMapping(value = "/guakezhishu/welcome", method = RequestMethod.GET)
    public void welcome() {
        System.out.println("welcome");
    }
    
    @RequestMapping(value = "/guakezhishu/home", method = RequestMethod.GET)
    public void home() {
        System.out.println("home");
    }

    @InitBinder
    public void initBinder(WebDataBinder binder) {
        binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), false));
    }

}